<template>
  <div class="notice-list">
    <app-header :back="true" titleContent="公告列表"></app-header>
    <div class="notice">
      <cell :title="item.title" :link="'/noticeDetail/'+item.id" v-for="(item,index) in noticeLists" :key="index" :inline-desc="item.author" :value="item.created_at*1000 | dateFmt('YYYY-MM-DD')"></cell>
    </div>
  </div>
</template>

<script>
import AppHeader from '../header/header'
import {getNoticeList} from '../../api/notice.js'
import {Cell} from 'vux'
export default {
  name: 'noticeList',
  data () {
    return {
      noticeList: []
    }
  },
  components: {
    AppHeader,
    Cell
  },
  created () {
    this._getNoticeList()
  },
  methods: {
    _getNoticeList () {
      getNoticeList(204).then(res => {
        this.noticeList = res.data
      })
    }
  },
  computed: {
    noticeLists () {
      return this.noticeList.reverse()
    }
  }
}
</script>

<style lang="less">
.notice-list{
  // padding-top: 40px;
  margin-bottom: 48px;
  .vux-label-desc {
    font-size: 12px;
    color: #0078de;
  }
  .weui-cell__ft{
    color: #0078de;
    font-size: 12px;
  }
}
</style>